package com.drinks.yiniang.entity.category;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.drinks.yiniang.entity.goods.GoodsJson;
import com.hansen.library.entity.BaseJson;

import java.util.List;

/**
 * 分类下商品
 * @author han
 * @date 2019/9/19
 */
public class CategoryGoodsJson extends BaseJson {

    public static final int ITEM_TYPE_CATEGORY_GOODS = 0x01;//分类商品
    //public static final int ITEM_TYPE_CATEGORY_HOT_TITLE = 0x02;//分类热门品牌标题
    public static final int ITEM_TYPE_CATEGORY_HOT_GOODS = 0x03;//分类热门品牌

    private CategoryGoodsData data;

    public CategoryGoodsData getData() {
        return data;
    }

    public void setData(CategoryGoodsData data) {
        this.data = data;
    }

    public static class CategoryGoodsData {
        private List<CategoryGoodsList> data;

        public List<CategoryGoodsList> getData() {
            return data;
        }

        public void setData(List<CategoryGoodsList> data) {
            this.data = data;
        }
    }

    public static class CategoryGoodsList extends GoodsJson.GoodsList implements MultiItemEntity {

        private int mItemType = ITEM_TYPE_CATEGORY_GOODS;
        private String sub_title;
        private String product_code;
        private String is_recommend;
        //库存
        private String stock;
        //前端添加热门品牌，区分item Type
        private CategoryHotBrandJson.CategoryHotBrandList tempHotBrand;

        public String getSub_title() {
            return sub_title;
        }

        public void setSub_title(String sub_title) {
            this.sub_title = sub_title;
        }

        public String getProduct_code() {
            return product_code;
        }

        public void setProduct_code(String product_code) {
            this.product_code = product_code;
        }

        public String getIs_recommend() {
            return is_recommend;
        }

        public void setIs_recommend(String is_recommend) {
            this.is_recommend = is_recommend;
        }

        public String getStock() {
            return stock;
        }

        public void setStock(String stock) {
            this.stock = stock;
        }

        public void setItemType(int mItemType) {
            this.mItemType = mItemType;
        }

        public CategoryHotBrandJson.CategoryHotBrandList getTempHotBrand() {
            return tempHotBrand;
        }

        public void setTempHotBrand(CategoryHotBrandJson.CategoryHotBrandList tempHotBrand) {
            this.tempHotBrand = tempHotBrand;
        }

        @Override
        public int getItemType() {
            switch (mItemType) {
                case ITEM_TYPE_CATEGORY_GOODS:
                //case ITEM_TYPE_CATEGORY_HOT_TITLE:
                case ITEM_TYPE_CATEGORY_HOT_GOODS:
                    return mItemType;
                default:
                    return BaseMultiItemQuickAdapter.TYPE_NOT_FOUND;

            }
        }
    }

}
